package com.lc.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Description: 拦截器
 * @Author lc
 */

@Configuration
public class WebConfig implements WebMvcConfigurer {

    /**
     * 注册拦截器
     * @param registry
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new AuthInterceptor())
                .addPathPatterns("/**") //拦截规定的请求
                .excludePathPatterns(
                        "/ums/user/login",
                        "/ums/sms/sendSms",
                        "/pms/product/**",
                        "/pms/comment/**",
                        "/ums/receiverAddress/pcdList"); //放行规定的请求
    }
}
